/*
 * @Author: wuyuxin
 * @Date: 2022-01-11 15:13:39
 * @LastEditors: wuyuxin
 * @LastEditTime: 2022-01-11 15:20:10
 * @Description: 
 */
export const NOT_LOADED = "NOT_LOADED"; // 没有加载过 应用初始状态
export const LOADING_SOURCE_CODE = "LOADING_SOURCE_CODE"; // 加载原代码 加载资源
export const NOT_BOOTSTRAPPED = "NOT_BOOTSTRAPPED"; // 没有启动 还没有调用bootstrap方法
export const BOOTSTRAPPING = "BOOTSTRAPPING"; // 启动中 调用bootstrap方法
export const NOT_MOUNTED = "NOT_MOUNTED"; // 没有挂载 没有调用mount方法
export const MOUNTING = "MOUNTING"; // 挂载中 调用mount方法
export const MOUNTED = "MOUNTED"; // 挂载完毕
export const UPDATING = "UPDATING"; // 更新中
export const UNMOUNTING = "UNMOUNTING"; // 卸载中 解除挂载
export const UNLOADING = "UNLOADING"; // 完全卸载中  回归没有加载中状态
export const LOAD_ERROR = "LOAD_ERROR"; // 加载失败
export const SKIP_BECAUSE_BROKEN = "SKIP_BECAUSE_BROKEN"; // 运行出错

export function isActive(app) { // 当前app是否已经挂载
    return app.status === MOUNTED;
}
export function shouldBeActive(app) { // 当前app是否应该激活 如果返回true，那么应用就应该开始初始化等一系列操作
    return app.activeWhen(window.location);
}